package com.sinosoft.dsp.persistence.businessconcept.atom;

import javax.measure.unit.Unit;

import com.sinosoft.dsp.persistence.businessconcept.utils.UnitHelper;

/**
 * 单位对象
 * 
 * @author 潘巍（Peter Pan）
 * @since 2011-4-23 下午04:41:34
 */
public class SinoUnitBean implements ISinoAtomType {
	private Unit<?> unit;

	public Unit<?> getUnit() {
		return unit;
	}

	public SinoUnitBean setUnit(Unit<?> unit) {
		this.unit = unit;
		return this;
	}

	public String getUnitName() {
		return UnitHelper.getUnitName(unit);
	}

	public SinoUnitBean setUnit(String unitName) {
		this.unit = UnitHelper.getUnit(unitName);
		return this;
	}

	@Override
	public boolean isEmpty() {
		return this.unit == null;
	}

}
